package com.shanzmoo.db.logistics.entity.vo;

import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.shanzmoo.db.logistics.entity.DeliveryLogisticsDetailEntity;
import lombok.*;

import java.io.Serializable;

/**
 * <p>
 * 发货单物流明细
 * </p>
 *
 * @author Gzhao
 * @since 2020-12-16
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@EqualsAndHashCode(callSuper = false)
@TableName("delivery_logistics_detail")
public class DeliveryLogisticsDetailVO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 自增ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 发货单id
     */
    private Integer deliveryId;

    /**
     * 发货类型：0-物流，1-自提
     */
    private Integer sendType;

    /**
     * 物流单号
     */
    private String logisticsNo;

    /**
     * 物流公司
     */
    private String logisticsCompany;


    public static DeliveryLogisticsDetailVO create(DeliveryLogisticsDetailEntity entity) {
        return JSON.parseObject(JSON.toJSONString(entity), DeliveryLogisticsDetailVO.class);
    }
}
